@script AddComponentMenu("Level4/Cameras/RoveCamera")
//////////////////////////////////////////////////////
///漫游 摄影机
//////////////////////////////////////////////////////

/**
	绕x轴上下旋转的角度范围.
*/
var minXAngle:float = -60;
var maxXAngle:float = 60;
/**
	旋转敏感度.
*/
var insentivityX:float = 2;
var insentivityY:float = 2;

function Update () {
	MouseLook();
}

function MouseLook(){
	var h:float = Input.GetAxis("Mouse X");
	var v:float = -Input.GetAxis("Mouse Y");
	// 绕x轴旋转
	// if(transform.eulerAngles.y <= maxXAngle && transform.eulerAngles.y >= minXAngle){
		transform.Rotate(Vector3.right * v * insentivityY);
	// }
	// 绕y轴旋转
	transform.RotateAround(transform.position,Vector3.up,h * insentivityX);
}

